home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Re: QUESTION:Random Numbers, etc
- Date: 26 Feb 1996 00:57:32 GMT
- Organization: AEtna Insurance Agency
- Message-ID: <4gr0hs$qck@masala.cc.uh.edu>
- References: <4gnpic$j5s@news1.usa.pipeline.com>
- NNTP-Posting-Host: sip-14149.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
-
- The actual BASIC formula (figured this one out myself) is:
-
- INT(RND*(MAX-MIN+1)+MIN)
-
- The TC++ 3.1 function random() can be used to generate a similar effect:
-
- random(max-min+1)+min;
-
- Hope VC++ has random()!
-
- --
- |\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\|
- Steven Sensarn -- txs53132@bayou.uh.edu
- |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
-
-
-